﻿<views:MvxWpfView 
	x:Class="Sidvall.IdentityManager.UI.Wpf.Views.UserProfileView"
	xmlns:Controls="clr-namespace:Sidvall.IdentityManager.UI.Wpf.Controls" 
	xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf" 
	xmlns:views="clr-namespace:MvvmCross.Wpf.Views;assembly=MvvmCross.Wpf"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:vms="clr-namespace:Sidvall.IdentityManager.UI.ViewModels;assembly=Sidvall.IdentityManager.UI"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
	xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
	xmlns:local="clr-namespace:Sidvall.IdentityManager.UI.Wpf.Views"
	mc:Ignorable="d" 
	d:DesignHeight="550" d:DesignWidth="800">

	<UserControl.Resources>
		<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
		<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" Collapsed="False" />
	</UserControl.Resources>

	<Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:UserProfileViewModel}}">
		<Grid>
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition Height="Auto" />
				<RowDefinition/>
				<RowDefinition Height="Auto" />
			</Grid.RowDefinitions>

			<Controls:HeaderControl HeaderCaption="{Binding Title}" />
			<TabControl Grid.Row="2" Margin="0,5,0,0">
				<TabItem Header="Information">
					<Grid Margin="0,0,5,0">
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition/>
						</Grid.RowDefinitions>

						<StackPanel>
							<Grid Margin="0,5,0,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="160" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Grid.Row="0" Content="Name:" />
								<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding UserName}" />
							</Grid>
							<Grid Margin="0,5,0,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="160" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Grid.Row="0" Content="Email:" />
								<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding ActiveEntity.Email}" />
							</Grid>
							<Grid Margin="0,5,0,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="160" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Grid.Row="0" Content="Phone Number:" />
								<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding ActiveEntity.PhoneNumber}" />
							</Grid>
						</StackPanel>
					</Grid>
				</TabItem>
			</TabControl>
			<Grid Grid.Row="3" Margin="0,5,0,5">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition />
				</Grid.ColumnDefinitions>

				<Button Grid.Column="1" Command="{Binding SaveCommand}" IsEnabled="{Binding IsSavable}" Padding="10,1" Margin="5,0,0,0">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition />
						</Grid.ColumnDefinitions>

						<Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Save.png" Width="24"/>
						<TextBlock Grid.Column="1" Text="Save" Margin="5,0,0,0" VerticalAlignment="Center" />
					</Grid>
				</Button>
			</Grid>
		</Grid>
	</Grid>
</views:MvxWpfView>
